/**
 * <p>
 * 表格配置
 *
 * @Author：Roy
 * @Description：碳中和规划
 * @Date：Create by 2023-12-01 10:45:08
 */
// 隐藏操作按钮的规则配置，字段名：isEdit
const isHidden = (list, row) => {
  const { isEdit } = row || {}
  return list.includes(String(isEdit))
}

const headerConfig = {
  'carbon-neutrality-plan': [
    {
      prop: 'projectName',
      name: '所属项目',
      minWidth: 110
    },
   /* {
      prop: 'edificeName',
      name: '所属楼栋',
      minWidth: 170
    }, {
      prop: 'floorName',
      name: '所属楼层',
      minWidth: 170
    },*/ {
      prop: 'planCarbonSequestration',
      name: '规划碳汇',
      minWidth: 170
    }, {
      prop: 'planCarbonEmissions',
      name: '规划碳排',
      minWidth: 170
    }, {
      prop: 'planCarbonZero',
      name: '规划碳减',
      minWidth: 170
    }, {
      prop: 'planCarbonNeutrality',
      name: '规划碳中和',
      minWidth: 170
    }, {
      name: '生效时间',
      minWidth: 170,
      formatter: (row) => {
        return row.effectiveTimeStart + '~' + row.effectiveTimeEnd
      }
    },
    {
      name: '操作',
      width: 200,
      fixed: 'right',
      thStyle: { 'text-align': 'left' },
      operateList: [
        /*{
          type: 'btnText',
          label: '复制',
          id: 'carbon-neutrality-plan-copy',
          authId: 'ecp-admin:carbonNeutralityPlan:copy',
          config: { type: 'text' },
          style: { color: 'rgb(66, 185, 131)' },
          hidden: (val) => {
            return false // !isHidden(['1'], val)
          }
        },{
          type: 'btnText',
          label: '详情',
          id: 'carbon-neutrality-plan-detail',
          authId: 'ecp-admin:carbonNeutralityPlan:detail',
          config: { type: 'text' },
          style: { color: 'rgb(66, 185, 131)' },
          hidden: (val) => {
            return false // !isHidden(['1'], val)
          }
        },*/ {
          type: 'btnText',
          label: '编辑',
          id: 'carbon-neutrality-plan-edit',
          authId: 'ecp-admin:carbonNeutralityPlan:update',
          config: { type: 'text' },
          style: { color: 'rgb(66, 185, 131)' },
          hidden: (val) => {
            return false // !isHidden(['1'], val)
          }
        },
        {
          type: 'btnText',
          label: '删除',
          id: 'carbon-neutrality-plan-delete',
          authId: 'ecp-admin:carbonNeutralityPlan:deleteById',
          isMore: true,
          config: { type: 'text' },
          style: { color: '#ff0000' },
          hidden: (val) => {
            return false // !isHidden(['1'], val)
          }
        }
      ]
    }
  ]
}

export default {}
export { headerConfig }
